package com.example.weli.ble2test;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.TextView;

public class acttitleActivity extends Activity {
    private CheckBox Nodisp;
    private joystick joyst;
    private JoystickMovedListener lister = new JoystickMovedListener() {
        @Override
        public void OnMoved(int pan, int tilt) {
            acttitleActivity.this.text1.setText(Integer.toString(pan) + ',' + Integer.toString(tilt));
        }

        public void OnReleased() {
        }

        public void OnReturnedToCenter() {
        }
    };
    private Button mSendButton;
    TextView text1;
    private WebView webv;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.title1);
        if (getSharedPreferences("perference", 0).getString("IsDisplay", BuildConfig.FLAVOR).equalsIgnoreCase("No")) {
            Intent intent = new Intent();
            intent.setClass(this, UIActivity.class);
            startActivity(intent);
            finish();
        }
        setTitle("\u6b22\u8fce\u4f7f\u7528\u84dd\u7259\u4e32\u53e3\u52a9\u624b");
        this.webv = (WebView) findViewById(R.id.web2);
        try {
            this.webv.loadUrl("file:///android_asset/hello.html");
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        this.Nodisp = (CheckBox) findViewById(R.id.Nodis);
        this.mSendButton = (Button) findViewById(R.id.btnCode);
        this.mSendButton.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                if (acttitleActivity.this.Nodisp.isChecked()) {
                    Editor editor = acttitleActivity.this.getSharedPreferences("perference", 0).edit();
                    editor.putString("IsDisplay", "No");
                    editor.commit();
                }
                Intent intent = new Intent();
                intent.setClass(acttitleActivity.this, UIActivity.class);
                acttitleActivity.this.startActivity(intent);
                acttitleActivity.this.finish();
            }
        });
    }

    protected void onDestroy() {
        super.onDestroy();
    }
}
